package com.ruoyi.resource.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.resource.mapper.SysBusinessResourceModelMapper;
import com.ruoyi.resource.domain.SysBusinessResourceModel;
import com.ruoyi.resource.service.ISysBusinessResourceModelService;

/**
 * 模型资源Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-12-22
 */
@Service
public class SysBusinessResourceModelServiceImpl implements ISysBusinessResourceModelService 
{
    @Autowired
    private SysBusinessResourceModelMapper sysBusinessResourceModelMapper;

    /**
     * 查询模型资源
     * 
     * @param modelId 模型资源主键
     * @return 模型资源
     */
    @Override
    public SysBusinessResourceModel selectSysBusinessResourceModelByModelId(Long modelId)
    {
        return sysBusinessResourceModelMapper.selectSysBusinessResourceModelByModelId(modelId);
    }

    /**
     * 查询模型资源列表
     * 
     * @param sysBusinessResourceModel 模型资源
     * @return 模型资源
     */
    @Override
    public List<SysBusinessResourceModel> selectSysBusinessResourceModelList(SysBusinessResourceModel sysBusinessResourceModel)
    {
        return sysBusinessResourceModelMapper.selectSysBusinessResourceModelList(sysBusinessResourceModel);
    }

    /**
     * 新增模型资源
     * 
     * @param sysBusinessResourceModel 模型资源
     * @return 结果
     */
    @Override
    public int insertSysBusinessResourceModel(SysBusinessResourceModel sysBusinessResourceModel)
    {
        sysBusinessResourceModel.setCreateTime(DateUtils.getNowDate());
        return sysBusinessResourceModelMapper.insertSysBusinessResourceModel(sysBusinessResourceModel);
    }

    /**
     * 修改模型资源
     * 
     * @param sysBusinessResourceModel 模型资源
     * @return 结果
     */
    @Override
    public int updateSysBusinessResourceModel(SysBusinessResourceModel sysBusinessResourceModel)
    {
        sysBusinessResourceModel.setUpdateTime(DateUtils.getNowDate());
        return sysBusinessResourceModelMapper.updateSysBusinessResourceModel(sysBusinessResourceModel);
    }

    /**
     * 批量删除模型资源
     * 
     * @param modelIds 需要删除的模型资源主键
     * @return 结果
     */
    @Override
    public int deleteSysBusinessResourceModelByModelIds(Long[] modelIds)
    {
        return sysBusinessResourceModelMapper.deleteSysBusinessResourceModelByModelIds(modelIds);
    }

    /**
     * 删除模型资源信息
     * 
     * @param modelId 模型资源主键
     * @return 结果
     */
    @Override
    public int deleteSysBusinessResourceModelByModelId(Long modelId)
    {
        return sysBusinessResourceModelMapper.deleteSysBusinessResourceModelByModelId(modelId);
    }
}
